package com.example.luckysystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @version 1.0
 * @Author shangjialu
 * @Date 2024/12/13 11:28
 * @注释
 */
@AllArgsConstructor
@Getter
public enum ActivityStatusEnum {
    //定义两个枚举常量
    RUNNING(1,"活动进行中"),
    COMPLETED(2, "活动已完成");

    //属性
    private final Integer code;
    private final String message;

    //获取枚举值
    public static ActivityStatusEnum forName(String name) {
        for (ActivityStatusEnum activityStatusEnum : ActivityStatusEnum.values()) {
            if (activityStatusEnum.name().equalsIgnoreCase(name)) {
                return activityStatusEnum;
            }
        }
        return null;
    }
}
